<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="viewport" content="height=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <title></title>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" href="css/register.css"/>
</head>
<body>
    <div class="register">
        <div class="regTop">
            <span>用户注册</span>
            <a class="back" href="login">&lt;&nbsp;返回</a>
        </div>
        <div class="content">
            <div class="point">
                <span>注册成功后，手机号也可为登录账号。</span>
            </div>
            <form method="post" action="register_ok">
                <?php echo csrf_field(); ?>
                <div class="message">
                    <input type="text" name="name" placeholder="真实姓名" required/>
                    <input type="text" name="username" placeholder="用户名" pattern="[0-9A-Za-z]{3,16}" required/>
                    <input type="password" name="password" placeholder="请输入6-25位密码" pattern="[0-9A-Za-z]{6,25}" required/>
                    <input type="tel" name="tel" placeholder="输入手机号" pattern="[0-9]{11}" required/>
                    </div>
                <div class="agree">
                    <input type="checkbox"/><span>&nbsp;同意&nbsp;</span><a href="">《注册协议》</a>
                </div>
                <button class="submit button" type="button">注册</button>
            </form>
        </div>
    </div>
</body>
</html>
<script src="/js/jquery-1.8.3.min.js"></script>
<script>
    $(".button").click(function(){
        $.ajax({
            type:"POST",
            url:"register_ok",
            data:$("form").serializeArray(),
            dataType:"json",
            success:function(msg){
                if(msg.code == 1){
                    alert(msg.msg);
                    location.href = 'login';
                }else if(msg.code == -1){
                    alert(msg.msg);
                }else if(msg.code == -2){
                    alert(msg.msg);
                }
            }
        });
    });
</script><?php /**PATH E:\laravel1\zu3_1801\resources\views/register.blade.php ENDPATH**/ ?>